'use strict';

const BaseController = require('../base');

class OrderCodeController extends BaseController {
  static get serviceName() {
    return 'business.orderCode';
  }

  async verify() {
    const { ctx } = this;
    const { code, shop_user_id } = ctx.request.body;
    const result = await this.ctx.service.business.orderCode.verify(code, shop_user_id);
    this.ctx.success(result)
  }

  async dailyStats() {
    const { ctx } = this;
    const { shop_user_id, date } = ctx.query;
    const result = await this.ctx.service.business.orderCode.getDailyStats(shop_user_id, date);
    this.ctx.success(result);
  }
}

module.exports = OrderCodeController;
